<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户登录</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f9;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        header {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 20px 0;
            width: 100%;
        }
        .form-container {
            background-color: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            width: 90%;
            max-width: 400px;
        }
        .form-container h2 {
            text-align: center;
            margin-bottom: 20px;
            color: #333;
        }
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #333;
        }
        .form-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
        .form-group input:focus {
            outline: none;
            border-color: #4CAF50;
            box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
        }
        .form-button {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
        }
        .form-button:hover {
            background-color: #45a049;
        }
        .switch-link {
            text-align: center;
            margin-top: 10px;
        }
        .switch-link a {
            text-decoration: none;
            color: #4CAF50;
            font-weight: bold;
        }
        .switch-link a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>

<header>
    <h1>用户登录</h1>
</header>

<div class="form-container">
    <h2>登录</h2>
    <form action="/login/" method="POST">
        {% csrf_token %}
        <div class="form-group">
            <label for="login-username">用户名或邮箱</label>
            <input type="text" id="login-username" name="username" placeholder="请输入用户名或邮箱" required>
        </div>
        <div class="form-group">
            <label for="login-password">密码</label>
            <input type="password" id="login-password" name="password" placeholder="请输入密码" required>
        </div>
        <button type="submit" class="form-button">登录</button>
    </form>
    <div class="switch-link">
        没有账号？<a href="/register">注册</a>
    </div>
</div>

</body>
</html>
